<!DOCTYPE html>
<html>
<head>
    <title></title>
    <meta http-equiv="content-type" content="text/html;charset=utf-8">
    <link rel="stylesheet" href="css/map.css">
    <link rel="stylesheet" href="css/bootstrap.css">
    <link rel="stylesheet" href="css/bootstrap-table.css">
    <style>

        .fixed-table-pagination .page-list {
            right: 270px;
        }

        .fixed-table-pagination div.pagination, .fixed-table-pagination .pagination-detail {
            right: 350px;
        }
        .fixed-table-toolbar{
            display: inline-block;
            position: fixed;
            top: 20px;
            right: 70px;
            width: 180px;
        }

        .fixed-table-toolbar .search{
            margin: 0;
        }

        #coverSetImport .fixed-table-toolbar input.form-control{
            height: 26px;
            width: 180px;
        }

</style>
</head>
<body>
<div id="cover">
    <img class="cover-small" src="images/small.png" onclick="closeCover()">
    <div id="coverGant"></div>
    <div id="coverTable">
        <h1></h1>
        <select id="coverTableSelect">
            <option value="0">所有浆员</option>
            <option value="8">今年已进站浆员</option>
            <option value="1">忠诚浆员</option>
            <option value="2">复苏浆员</option>
            <option value="3">今年新浆员</option>
            <option value="7">未被链接浆员</option>
            <option value="9">今年未进站浆员</option>
            <option value="4">休眠浆员</option>
            <option value="5">流失浆员</option>
            <option value="6">已链接的休眠浆员</option>
            <option value="10">未链接的休眠浆员</option>
        </select>
        <button>提交修改</button>
        <div class=table-responsive">
            <table id="thisTown" class="table"></table>
        </div>
        <div class="table-responsive">
            <table id="table"></table>
        </div>
    </div>
    <div id="coverSetImport">
        <h1></h1>
        <div class="table-responsive" style=" margin-top:20px;">
            <table id="setImport3" cellpadding="0" cellspacing="0" style="table-layout:fixed">
                <thead></thead>
            </table>
        </div>
        <div class="table-responsive">
            <table id="setImport"></table>
        </div>
    </div>
</div>
<div id="popup" class="popup" style="display: none;">
    <h1></h1>
    <img src="images/close.png" width="27px" onclick="closePopup()" alt="关闭">
    <div class="popup-content"></div>
</div>
<div id="popup1" class="popup" style="display: none;">
    <h1></h1>
    <img src="images/close.png" width="27px" onclick="closePopup1()" alt="关闭">
    <div class="popup-content"></div>
</div>

<div class="select_time left">
    <span class="select_date">选择日期</span>
    <input type="button" class="select_prev" value="上一天">
    <input type="button" class="select_next" value="下一天">
    <input type="button" class="select_now" value="当天">
    <span class="write_date"></span>
</div>
<div id="map"></div>
</body>
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.js"></script>
<script src="js/bootstrap-table.js"></script>
<script src="js/template.js"></script>
<script src="js/vii-placeholder.js"></script>
<script src="http://api.map.baidu.com/api?v=2.0&ak=6fdSEWevSinfjYEeFOPPIqu5FSrv6OUV"></script>
<script src="js/echarts4.min.js"></script>
<script src="js/bmap.min.js"></script>
<script src="js/common.js"></script>
<script src="js/mapCommon.js"></script>
<script>

    /*
     * --------------初始化----------------------------------------------------------------
     * */

    var importVillageMap,
        legendSelect = {
            "新浆员": false,
            "积极浆员": false,
            "当天所有浆员": false,
            "所有浆员": false,
            "忠诚浆员": false,
            "复苏浆员": false,
            "今年新浆员": false,
            "休眠浆员": false,
            "流失浆员": false,
            "已链接休眠的浆员": false,
            "未被链接浆员": false,
            "今年已进站": false,
            "今年未进站": false,
            "未链接休眠的浆员": false,
            "A类重点村": true,
            "B类重点村": true,
            "C类重点村": true
        };

    /*
     * ------------------ajax请求--------------------------------------------------------------
     * */

    //getImportVillageAjax获取重点村
    function getImportVillageAjax() {
        $.ajax({
            url: "http://60.164.210.223:7577/Nvr/map/getAutoKeyVillDzJwd",
            dataType: "jsonp",
            type: 'POST',
            success: function (list) {
                importVillageMap = list;
                initMap();
            },
            error: function (error) {
                alert("获取重点村请求失败！");
            }
        });
    }


    //getVillageListAjax获取村列表
    function getVillageListAjax(callback) {
        $.ajax({
            url: "http://60.164.210.223:7577/Nvr/map/getAllAutoKeyVill",
            dataType: "jsonp",
            type: 'POST',
            beforeSend: function () {
                placeholder.show(document.body);
            },
            success: function (item) {
                callback(item);
            },
            error: function (error) {
                alert("获取村列表请求失败！");
                placeholder.hide(document.body);
                $(".vii-holder-mask").hide();
            }
        });
    }

    /*
     * ------------打开关闭------------------------------------------------------------------------
     * */

    //OpenCoverSetImport打开设置重点村
    function OpenCoverSetImport() {
        $("#cover").fadeIn();
        $("#coverSetImport").fadeIn();
        $("#cover > .cover-small").css("display", "block");
        getVillageListAjax(function (item) {
            initImportVillage(item);
        });
    }

    //initImportVillage 生成重点村
    function initImportVillage(item) {
        $("#coverSetImport>h1").text("重点村（ A类：" + importVillageMap.kmA.length + " 个；B类：" + importVillageMap.kmB.length + " 个；C类：" + importVillageMap.kmC.length + " 个）");
        //TFoot
        var tableFoot = "<tr>" +
            "<td style='width:2.2%;' class='c_000 bg_f9c'>" + (item.totalVills[0].id ? item.totalVills[0].id : ("0")+item.allVills.length) + "</td>" +
            "<td style='width:7.6%;' class='c_000 bg_f9c'>" + (item.totalVills[0].villageName ? item.totalVills[0].villageName : "甘肃省岷县采浆站") + "</td>" +
            "<td style='width:2.2%;' class='c_000 bg_f9c'>" + importVillageMap.kmA.length + "</td>" +
            "<td style='width:2.2%;' class='c_000 bg_f9c'>" + importVillageMap.kmB.length + "</td>" +
            "<td style='width:2.2%;' class='c_000 bg_f9c'>" + importVillageMap.kmC.length + "</td>" +
            "<td style='width:2.2%;' class='c_000 bg_f3d'>" + item.totalVills[0].allProviderNum + "</td>" +
            "<td style='width:2.2%;' class='c_000 bg_f3d'>" + item.totalVills[0].lastYearCollNum + "</td>" +
            "<td style='width:2.2%;' class='c_000 bg_f3d'>" + item.totalVills[0].currentTimePNum + "</td>" +
            "<td style='width:2.2%;' class='c_000 bg_f3d'>" + item.totalVills[0].lastTimePNum + "</td>" +
            "<td style='width:2.2%;' class='c_000 bg_f3d'>" + item.totalVills[0].currentTimeCollNum + "</td>" +
            "<td style='width:2.2%;' class='c_000 bg_f3d'>" + item.totalVills[0].lastTimeCollNum + "</td>" +
            "<td style='width:2.2%;' class='c_000 bg_f3d'>" + item.totalVills[0].collNumDiff + "</td>" +
            "<td style='width:2.2%;' class='c_000 bg_d9e'>" + item.totalVills[0].currentTimeAddPNum + "</td>" +
            "<td style='width:2.2%;' class='c_000 bg_d9e'>" + item.totalVills[0].lastTimeAddPNum + "</td>" +
            "<td style='width:2.2%;' class='c_000 bg_d9e'>" + item.totalVills[0].addNumDiff + "</td>" +
            "<td style='width:2.2%;' class='c_000 bg_d9e'>" + item.totalVills[0].currentTimeAddCollNum + "</td>" +
            "<td style='width:2.2%;' class='c_000 bg_d9e'>" + item.totalVills[0].lastTimeAddCollNum + "</td>" +
            "<td style='width:2.2%;' class='c_000 bg_d1c'>" + item.totalVills[0].currentTimeFuSuPNum + "</td>" +
            "<td style='width:2.2%;' class='c_000 bg_d1c'>" + item.totalVills[0].currentTimeFuSuCollNum + "</td>" +
            "<td style='width:2.2%;' class='c_000 bg_f3d'>" + item.totalVills[0].currentTimeZCPNum + "</td>" +
            "<td style='width:2.2%;' class='c_000 bg_f3d'>" + item.totalVills[0].lastTimeZCPNum + "</td>" +
            "<td style='width:2.2%;' class='c_000 bg_f3d'>" + item.totalVills[0].currentTimeZCCollNum + "</td>" +
            "<td style='width:2.2%;' class='c_000 bg_f3d'>" + item.totalVills[0].lastTimeZCCollNum + "</td>" +
            "<td style='width:2.2%;' class='c_000 bg_f3d'>" + item.totalVills[0].zcCollNumDiff + "</td>" +
            "<td style='width:2.2%;' class='c_000 bg_f3d'>" + item.totalVills[0].lastYearZCCollNum + "</td>" +
            "<td style='width:2.2%;' class='c_000 bg_f9c'>" + item.totalVills[0].currentTimeNotComedPNum + "</td>" +
            "<td style='width:2.2%;' class='c_000 bg_f9c'>" + item.totalVills[0].currentTimeNotComedPLastYearCollNum + "</td>" +
            "<td style='width:2.2%;' class='c_000 bg_d9e'>" + item.totalVills[0].xiuMianPNum + "</td>" +
            "<td style='width:2.2%;' class='c_000 bg_d9e'>" + item.totalVills[0].lastYearXiuMianCollNum + "</td>" +
            "<td style='width:2.2%;' class='c_000 bg_d9e'>" + item.totalVills[0].lastTimeXiuMianCollNum + "</td>" +
            "<td style='width:2.2%;' class='c_000 bg_d1c'>" + item.totalVills[0].liuShiPNum + "</td>" +
            "<td style='width:2.2%;' class='c_000 bg_f3d'>" + item.totalVills[0].comedNotConnPNum + "</td>" +
            "<td style='width:2.2%;' class='c_000 bg_f3d'>" + item.totalVills[0].comedNotConnThisTimeCollNum + "</td>" +
            "<td style='width:2.2%;' class='c_000 bg_f3d'>" + item.totalVills[0].comedNotConnLastTimeCollNum + "</td>" +
            "<td style='width:2.2%;' class='c_000 bg_f3d'>" + item.totalVills[0].comedNotConnLastYearCollNum + "</td>" +
            "<td style='width:2.2%;' class='c_000 bg_d9e'>" + item.totalVills[0].connXMPNum + "</td>" +
            "<td style='width:2.2%;' class='c_000 bg_d9e'>" + item.totalVills[0].lastTimeConnXMCollNum + "</td>" +
            "<td style='width:2.2%;' class='c_000 bg_d1c'>" + item.totalVills[0].notConnXMPNum + "</td>" +
            "<td style='width:2.2%;' class='c_000 bg_d1c'>" + item.totalVills[0].lastTimeNotConnXMCollNum + "</td>" +
            "<td style='width:2.2%;' class='c_000 bg_f3d'>" + item.totalVills[0].connNurseNum + "</td>" +
            "<td style='width:2.2%;' class='c_000 bg_f3d'>" + item.totalVills[0].connedPNum + "</td>" +
            "<td style='width:2.2%;' class='c_000 bg_f9c'>" + item.totalVills[0].volunteerNum+ "</td>" +
            "<td style='width:2.2%;' class='c_000 bg_f9c'>" + item.totalVills[0].volunConnGJZNum + "</td>" +
            "</tr>";

        var width = $("#setImport3").parent().width() - 17;
        $("#setImport3").css("cssText","width:"+width+"px!important");
        $("#setImport3 thead").html(tableFoot);
        //bottomTable
        $("#setImport").bootstrapTable('destroy').bootstrapTable({
            cache:false,
            data: item.allVills,
            height: document.body.clientHeight - 70 - $("#coverSetImport>h1").height() - $("#setImport3").height(),
            undefinedText:"",
            pagination: true,
            paginationLoop: true,
            pageSize: 30,
            pageList: [10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 40, 50 ,60 ,70,80,90,100, "All"],
            paginationVAlign: "top",
            paginationHAlign: "left",
            search:true,
            columns: [
                {
                    width: "2.2%",
                    class:"bg_f9c c_000",
                    title: '序号',
                    sortable: true,
                    field:"",
                    formatter:function (value,row,index) {
                        return  index+1;
                    }
                },
                {
                    width: "7.6%",
                    class:"bg_f9c c_000",
                    title: '村名',
                    sortable: true,
                    field:"villageName",
                    formatter:function (value,row,index) {
                        return value.substr(3);
                    }
                },
                {
                    field: "keyManageA",
                    title: 'A:重点管理村' ,
                    class:"bg_f9c c_000",
                    sortable: true,
                    width: "2.2%",
                    formatter:function (value,row,index) {
                        return value ? "是" : "";
                    }
                },
                {
                    field: "keyManageB",
                    title: 'B:重点管理村' ,
                    class:"bg_f9c c_000",
                    sortable: true,
                    width:"2.2%",
                    formatter:function (value,row,index) {
                        return value ? "是" : "";
                    }
                },
                {
                    field: "keyManageC",
                    title: 'C:重点管理村' ,
                    class:"bg_f9c c_000",
                    sortable: true,
                    width: "2.2%",
                    formatter:function (value,row,index) {
                        return value ? "是" : "";
                    }
                },
                {
                    field: 'allProviderNum',
                    width:"2.2%",
                    class:"c_000 bg_f3d",
                    sortable: true,
                    title: '注册浆员总人数',
                    formatter: function (value, row, index) {
                        return value === 0 ? "" : value
                    }
                },
                {
                    field: 'lastYearCollNum',
                    width:"2.2%",
                    class:"c_000 bg_f3d",
                    sortable: true,
                    title: '去年浆量/袋',
                    formatter: function (value, row, index) {
                        return value === 0 ? "" : value
                    }
                },
                {
                    field: 'currentTimePNum',
                    width:"2.2%",
                    class:"c_000 bg_f3d",
                    sortable: true,
                    title: '当期进站人数',
                    formatter: function (value, row, index) {
                        return value === 0 ? "" : value
                    }
                },
                {
                    field: "lastTimePNum",
                    class:"c_000 bg_f3d",
                    sortable: true,
                    width:"2.2%",
                    title: '同期进站人数',
                    formatter: function (value, row, index) {
                        return value === 0 ? "" : value
                    }
                },
                {
                    field: 'currentTimeCollNum',
                    class:"c_000 bg_f3d",
                    width:"2.2%",
                    sortable: true,
                    align:"center",
                    title: '当期浆量/袋',
                    formatter: function (value, row, index) {
                        return value === 0 ? "" : value
                    }
                },
                {
                    field: 'lastTimeCollNum',
                    title: '同期浆量/袋',
                    class:"c_000 bg_f3d",
                    width: "2.2%",
                    sortable: true,
                    formatter: function (value, row, index) {
                        return value === 0 ? "" : value
                    }
                },
                {
                    field: 'collNumDiff',
                    width: "2.2%",
                    sortable: true,
                    class:"c_000 bg_f3d",
                    title: '当期与同期浆量差/袋',
                    formatter: function (value, row, index) {
                        return value === 0 ? "" : value
                    }
                },
                {
                    field: 'currentTimeAddPNum',
                    width: "2.2%",
                    sortable: true,
                    title: '当期新增人数',
                    class: "c_000 bg_d9e",
                    formatter: function (value, row, index) {
                        return value === 0 ? "" : value
                    }
                },
                {
                    field: 'lastTimeAddPNum',
                    class: "c_000 bg_d9e",
                    width: "2.2%",
                    title: '同期新增人数',
                    formatter: function (value, row, index) {
                        return value === 0 ? "" : value
                    }
                },
                {
                    title:"新增浆员当期与同期差/袋",
                    class: "c_000 bg_d9e",
                    width: "2.2%",
                    sortable: true,
                    field:"addNumDiff",
                    formatter: function (value, row, index) {
                        return value === 0 ? "" : value
                    }
                },
                {
                    field: 'currentTimeAddCollNum',
                    width: "2.2%",
                    sortable: true,
                    class: "c_000 bg_d9e",
                    title: '当期新增浆量/袋',
                    formatter: function (value, row, index) {
                        return value === 0 ? "" : value
                    }
                },
                {
                    title:"同期新增浆量/袋",
                    class: "c_000 bg_d9e",
                    width: "2.2%",
                    sortable: true,
                    field:"lastTimeAddCollNum",
                    formatter: function (value, row, index) {
                        return value === 0 ? "" : value
                    }
                },

                {
                    title:"当期复苏浆员总人数",
                    class:"c_000 bg_d1c",
                    width: "2.2%",
                    sortable: true,
                    field:"currentTimeFuSuPNum",
                    formatter: function (value, row, index) {
                        return value === 0 ? "" : value
                    }
                },
                {
                    title:"当期复苏浆员浆量/袋",
                    class:"c_000 bg_d1c",
                    width: "2.2%",
                    sortable: true,
                    field:"currentTimeFuSuCollNum",
                    formatter: function (value, row, index) {
                        return value === 0 ? "" : value
                    }
                },
                {
                    title:"忠诚浆员当期总人数",
                    class:"c_000 bg_f3d",
                    width: "2.2%",
                    sortable: true,
                    field:"currentTimeZCPNum",
                    formatter: function (value, row, index) {
                        return value === 0 ? "" : value
                    }
                },
                {
                    title:"忠诚浆员同期总人数",
                    class:"c_000 bg_f3d",
                    width: "2.2%",
                    sortable: true,
                    field:"lastTimeZCPNum",
                    formatter: function (value, row, index) {
                        return value === 0 ? "" : value
                    }
                },
                {
                    title:"忠诚浆员当期浆量/袋",
                    class:"c_000 bg_f3d",
                    width: "2.2%",
                    sortable: true,
                    field:"currentTimeZCCollNum",
                    formatter: function (value, row, index) {
                        return value === 0 ? "" : value
                    }
                },
                {
                    title:"忠诚浆员同期浆量/袋",
                    class:"c_000 bg_f3d",
                    width: "2.2%",
                    sortable: true,
                    field:"lastTimeZCCollNum",
                    formatter: function (value, row, index) {
                        return value === 0 ? "" : value
                    }
                },
                {
                    title:"忠诚浆员浆量当期与同期差/袋",
                    class:"c_000 bg_f3d",
                    width: "2.2%",
                    sortable: true,
                    field:"zcCollNumDiff",
                    formatter: function (value, row, index) {
                        return value === 0 ? "" : value
                    }
                },
                {
                    title:"忠诚浆员去年浆量/袋",
                    class:"c_000 bg_f3d",
                    width: "2.2%",
                    sortable: true,
                    field:"lastYearZCCollNum",
                    formatter: function (value, row, index) {
                        return value === 0 ? "" : value
                    }
                },
                {
                    title:"当期未进站总人数",
                    class:"c_000 bg_f9c",
                    width: "2.2%",
                    sortable: true,
                    field:"currentTimeNotComedPNum",
                    formatter: function (value, row, index) {
                        return value === 0 ? "" : value
                    }
                },
                {
                    title:"当期未进站总人数去年浆量/袋",
                    class:"c_000 bg_f9c",
                    width: "2.2%",
                    sortable: true,
                    field:"currentTimeNotComedPLastYearCollNum",
                    formatter: function (value, row, index) {
                        return value === 0 ? "" : value
                    }
                },
                {
                    title:"休眠浆员总人数",
                    class:"c_000 bg_d9e",
                    width: "2.2%",
                    sortable: true,
                    field:"xiuMianPNum",
                    formatter: function (value, row, index) {
                        return value === 0 ? "" : value
                    }
                },
                {
                    title:"休眠浆员去年浆量/袋",
                    class:"c_000 bg_d9e",
                    width: "2.2%",
                    sortable: true,
                    field:"lastYearXiuMianCollNum",
                    formatter: function (value, row, index) {
                        return value === 0 ? "" : value
                    }
                },
                {
                    title:"休眠浆员同期浆量/袋",
                    class:"c_000 bg_d9e",
                    width: "2.2%",
                    sortable: true,
                    field:"lastTimeXiuMianCollNum",
                    formatter: function (value, row, index) {
                        return value === 0 ? "" : value
                    }
                },
                {
                    title:"流失浆员总人数",
                    class:"c_000 bg_d1c",
                    width: "2.2%",
                    sortable: true,
                    field:"liuShiPNum",
                    formatter: function (value, row, index) {
                        return value === 0 ? "" : value
                    }
                },
                {
                    title:"进站未链接浆员",
                    class:"c_000 bg_f3d",
                    width: "2.2%",
                    sortable: true,
                    field:"comedNotConnPNum",
                    formatter: function (value, row, index) {
                        return value === 0 ? "" : value
                    }
                },
                {
                    title:"进站未链接浆员当期浆量/袋",
                    class:"c_000 bg_f3d",
                    width: "2.2%",
                    sortable: true,
                    field:"comedNotConnThisTimeCollNum",
                    formatter: function (value, row, index) {
                        return value === 0 ? "" : value
                    }
                },
                {
                    title:"进站未链接浆员同期浆量/袋",
                    class:"c_000 bg_f3d",
                    width: "2.2%",
                    sortable: true,
                    field:"comedNotConnLastTimeCollNum",
                    formatter: function (value, row, index) {
                        return value === 0 ? "" : value
                    }
                },
                {
                    title:"进站未链接浆员去年浆量/袋",
                    class:"c_000 bg_f3d",
                    width: "2.2%",
                    sortable: true,
                    field:"comedNotConnLastYearCollNum",
                    formatter: function (value, row, index) {
                        return value === 0 ? "" : value
                    }
                },
                {
                    title:"已链接休眠的浆员人数",
                    class:"c_000 bg_d9e",
                    width: "2.2%",
                    sortable: true,
                    field:"connXMPNum",
                    formatter: function (value, row, index) {
                        return value === 0 ? "" : value
                    }
                },
                {
                    title:"已链接休眠的浆员同期浆量/袋",
                    class:"c_000 bg_d9e",
                    width: "2.2%",
                    sortable: true,
                    field:"lastTimeConnXMCollNum",
                    formatter: function (value, row, index) {
                        return value === 0 ? "" : value
                    }
                },
                {
                    title:"未链接休眠的浆员人数",
                    class:"c_000 bg_d1c",
                    width: "2.2%",
                    sortable: true,
                    field:"notConnXMPNum",
                    formatter: function (value, row, index) {
                        return value === 0 ? "" : value
                    }
                },
                {
                    title:"未链接休眠的浆员同期浆量/袋",
                    class:"c_000 bg_d1c",
                    width: "2.2%",
                    sortable: true,
                    field:"lastTimeNotConnXMCollNum",
                    formatter: function (value, row, index) {
                        return value === 0 ? "" : value
                    }
                },
                {
                    title:"管理护士总人数",
                    class:"c_000 bg_f3d",
                    width: "2.2%",
                    sortable: true,
                    field:"connNurseNum",
                    formatter: function (value, row, index) {
                        return value === 0 ? "" : value
                    }
                },
                {
                    title:"已链接浆员总人数",
                    class:"c_000 bg_f3d",
                    width: "2.2%",
                    sortable: true,
                    field:"connedPNum",
                    formatter: function (value, row, index) {
                        return value === 0 ? "" : value
                    }

                },
                {
                    title:"义工总人数",
                    class:"c_000 bg_f9c",
                    width: "2.2%",
                    sortable: true,
                    field:"volunteerNum",
                    formatter: function (value, row, index) {
                        return value === 0 ? "" : value
                    }
                },
                {
                    title:"义工管理浆员总人数",
                    class:"c_000 bg_f9c",
                    width: "2.2%",
                    sortable: true,
                    field:"volunConnGJZNum",
                    formatter: function (value, row, index) {
                        return value === 0 ? "" : value
                    }

                }
            ]
        });

        //hidePlaceholder
        placeholder.hide(document.body);
        $(".vii-holder-mask").hide();
    }

    window.onload = function () {
        setDayStyle();
        getImportVillageAjax();
        newPulpTodayAjax();// 当天新浆员
        positivePulpTodayAjax(); //当天积极浆员
        allPulpTodayAjax();  //当天所有浆员
        allPulpTodayvillageAjax(); //当天所有村落浆员
        allPulpAjax(); //所有浆员
        mapTypeAjax(); //全部浆员分类
        playInterval();//定时刷新
    }

</script>
</html>